<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ page import="br.com.seuimovelnamao.Util"%>

<% 
request.setAttribute("semmapa", 1); 
String more = "<script type=\"text/javascript\" src=\"http://maps.googleapis.com/maps/api/js?key="+Util.GOOGLE_MAPS_KEY+"&sensor=false\"></script>" +
"<script type=\"text/javascript\">" +
"var script = '<script type=\"text/javascript\" src=\"http://google-maps-' +"+
"      'utility-library-v3.googlecode.com/svn/trunk/infobubble/src/infobubble';"+
"  if (document.location.search.indexOf('compiled') !== -1) {"+
"    script += '-compiled';"+ 
"  }"+
"  script += '.js\"><' + '/script>';"+
"  document.write(script);"+
"</script>"+
"<script type=\"text/javascript\">"+
"var map;var map_pj;var marker;var marker_pj;"+
"var mapOptions = {	center : new google.maps.LatLng(-14.604847, -47.197266),	zoom : 3,	panControl : false,	zoomControl : true,	mapTypeControl : false,	scaleControl : false,	streetViewControl : true,	overviewMapControl : false,	mapTypeId : google.maps.MapTypeId.ROADMAP};"+
"$(document).ready(function() {	map = new google.maps.Map(document.getElementById(\"map\"), mapOptions); adicionaMarkerImovel();	});"+
"</script>";
request.setAttribute("more", more);
%>

<c:import url="/views/includes/header.jsp" />



<div class="container">
	<div class="content">
		<div style="border-top: #ccc solid 1px" id="divtop">
			<p>${imovel.titulo}</p>
			<p>${imovel.endereco.nomeCompleto}, ${imovel.endereco.bairro.nome}, ${imovel.endereco.cidade.nome} - ${imovel.endereco.estado.uf}</p>
			<p>${imovel.preco}</p>
			<p>Dormitorios: ${imovel.dormitorios}</p>
			<p>Banheiros: ${imovel.banheiros}</p>
			<p>Vagas: ${imovel.vagasGaragem}</p>
			
			<div id="map" style="width: 300px; height: 300px"></div>
		</div>
		
		<script type="text/javascript">
		function adicionaMarkerImovel(){
			var marker = new google.maps.Marker({
				position : new google.maps.LatLng(${imovel.lat}, ${imovel.lng}),
				map : map,
				icon : "/images/markers/marker.png",
				shadow : "/images/shadow-marker.png",
				title : ""
			});
			
			map.setCenter(marker.getPosition());
			map.setZoom(16);
		}
		</script>

<c:import url="/views/includes/footer.jsp" />